package cn.edu.scau.disk.utils;

import com.baomidou.mybatisplus.core.enums.IEnum;

import java.io.Serializable;

public enum ErrorCode implements IEnum {
    /**
     * 错误码枚举
     */
    NO_AUTH(401,"没有权限"),
    SUCCESS(200,"操作成功"),
    FAIL(500,"操作失败"),
    BAD_REQ(400,"参数不正确"),
    NO_METHOD(404,"资源不存在"),
    ;


    private int code;
    private String msg;

    ErrorCode(int code,String msg){
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


    @Override
    public Serializable getValue() {
        return this.code;
    }
}
